package com.lei.chinese_herbal_medicine.Controller;

import com.lei.chinese_herbal_medicine.Entity.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class HomeController {
    Result result;
    @GetMapping("/getHomeData")
    @ResponseBody
    public Result getHomeData(String token){
        System.out.println(token);
        result=new Result();
        result.setCode(200);
        Map map=new HashMap();
        Map tableData=new HashMap();
        tableData.put("name","当归");
        tableData.put("latin_name","Pinellia ternata ternata ternata");
        tableData.put("accuracy_rate",88);
        List list=new ArrayList<>();
        list.add(tableData);
        map.put("tableData",list);
        result.setData(map);
        return result;
    }
}
